package com.xpj.service;

import com.xpj.annotation.MyAsync;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

@Service
public class AsyncService {

    @MyAsync
    public void asyncSendMail(){

        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("2. send mail");
    }
}
